#include "stdhlp.h"
#include "Win32.h"
#include "WinForm.h"

LRESULT CALLBACK MainWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	// Get the pointer for our App that we passed through the 'CREATESTRUCT' 
	// structure pointer when we called CreateWindowEx().

	static WinForm * pApp = 0;
	switch (uMsg)
	{
		case WM_CREATE: 
		CREATESTRUCT* cs = (CREATESTRUCT*)lParam;
		pApp = (WinForm*)cs->lpCreateParams;
		return 0;
	}

	if (pApp)
		return pApp->MsgProc(uMsg, wParam, lParam);
	else
		return DefWindowProc(hwnd, uMsg, wParam, lParam);
}

// Application entry point.
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	WinForm a(hInstance, L"test", L"test");
	a.Init(400, 400);
	return a.Run();
}